home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr01 / jock.zip / TOTDEM11.ZIP / DEMIO18.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-11  |  2KB  |  103 lines

  1. program DemoIOEighteen;
  2. {demIO18 - an extension of demio17 using a moveable dialog box}
  3.  
  4. Uses DOS, CRT,
  5.      totFAST, totIO1, totIO2, totSTR;
  6.  
  7. var
  8.   Search: LateralIOOBJ;
  9.   Field1: CheckIOOBJ;
  10.   Field2,
  11.   Field3,
  12.   Field4: RadioIOOBJ;
  13.   OK,Cancel: Strip3dIOOBJ;
  14.   Keys: ControlKeysIOOBJ;
  15.   Manager: WinFormOBJ;
  16.   Result: tAction;
  17.  
  18. procedure InitVars;
  19. {}
  20. begin
  21.    with Search do
  22.    begin
  23.       Init(10,2,40,60);
  24.       SetLabel('~S~earch');
  25.       SetHotKey(287); {Alt-S}
  26.    end;
  27.    with Field1 do
  28.    begin
  29.       Init(3,4,25,4,'Options');
  30.       AddItem('~C~ase sensitive',302,false);
  31.       AddItem('~W~hole words only',273,false);
  32.       AddItem('~R~egular expression',275,false);
  33.    end;
  34.    with Field2 do
  35.    begin
  36.       Init(3,8,25,3,'Scope');
  37.       AddItem('~G~lobal',290,true);
  38.       AddItem('Selected ~t~ext',276,false);
  39.    end;
  40.    with Field3 do
  41.    begin
  42.       Init(33,4,17,3,'Direction');
  43.       AddItem('Forwar~d~',288,true);
  44.       AddItem('~B~ackward',304,false);
  45.    end;
  46.    with Field4 do
  47.    begin
  48.       Init(33,8,17,3,'Origin');
  49.       AddItem('~F~rom cursor',289,false);
  50.       AddItem('~E~ntire scope',274,true);
  51.    end;
  52.    OK.Init(6,12,'   ~O~K   ',Finished);
  53.    OK.SetHotkey(280);
  54.    Cancel.Init(20,12,' C~a~ncel ',Escaped);
  55.    Cancel.SetHotkey(286);
  56.    Keys.Init;
  57. end; {InitVars}
  58.  
  59. procedure DisposeVars;
  60. {}
  61. begin
  62.    Search.Done;
  63.    Field1.Done;
  64.    Field2.Done;
  65.    Field3.Done;
  66.    Field4.Done;
  67.    OK.Done;
  68.    Cancel.Done;
  69.    Keys.Done;
  70. end; {DisposeVars}
  71.  
  72. begin
  73.    InitVars;
  74.    Screen.Clear(white,'░'); {paint the screen}
  75.    with Manager do
  76.    begin
  77.       Init;
  78.       Win^.SetSize(14,2,65,16,1);
  79.       Win^.SetTitle(' Press Tab to change fields. ');
  80.       AddItem(Keys);
  81.       AddItem(Search);
  82.       AddItem(Field1);
  83.       AddItem(Field2);
  84.       AddItem(Field3);
  85.       AddItem(Field4);
  86.       AddItem(OK);
  87.       AddItem(Cancel);
  88.       Draw;
  89.       Result := Go;
  90.       Win^.Remove;
  91.       if Result = Finished then
  92.       begin
  93.          GotoXY(1,18);
  94.       end
  95.       else
  96.       begin
  97.          GotoXY(1,20);
  98.          writeln('You escaped!');
  99.       end;
  100.       DisposeVars;
  101.       Done;
  102.    end;
  103. end.